package com.sh.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sh.dao.UsersDao;
import com.sh.entity.Users;
import com.sh.util.Result;

@RestController
public class UserController {
	@Autowired
	UsersDao usersDao;
	@RequestMapping("/selectUser")
	public Result getAll(Integer page,Integer limit,Map<String, Object> map,Users user) {
		map.put("page", (page-1) * limit);
		map.put("limit", limit);
		map.put("ULoginName", user.getUloginName());
		List<Map<String, Object>> getAll=usersDao.getAll(map);
		Integer getCount = usersDao.getCount();
		Result res = new Result(0,"",getCount,getAll);
		return res;
	} 
}
